/*
 * @Author: 搁浅小时光 mork_wu@163.com
 * @Date: 2022-06-29 17:42:29
 * @LastEditors: 搁浅小时光 mork_wu@163.com
 * @LastEditTime: 2022-06-30 14:28:34
 * @FilePath: \limsVite\vite.config.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve:{
    alias:{
      '@':resolve(__dirname, 'src'),
      'c':resolve('src/components')
    }
  },
  base:'./',
  server: {
    port: 3008, // 服务端口号
    open: true, // 服务启动时是否自动打开浏览器
    cors: true, // 允许跨域
    proxy: {
      '/api': {
        target: 'https://api.lims2.com/api',
        changeOrigin: true,
        rewrite: (path) => path.replace('/api', '')
      }
    }
  }
})
